package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/api/v1/sensitive")
public class WmSensitiveController {

    @Autowired
    private WmSensitiveService wmSensitiveService;

    /*
    * 删除
    * */
    @DeleteMapping("/del/{id}")
    public ResponseResult deleted(@PathVariable("id") Integer id){
         return ResponseResult.okResult(wmSensitiveService.deleted(id));
    }

    /*
    * 查询·
    * */
    @PostMapping("/api/v1/sensitive/list")
    public ResponseResult  list(@RequestBody SensitiveDto dto){
        return ResponseResult.okResult(wmSensitiveService.list(dto));
    }

    /*
    *保存
    * */
    @PostMapping("/api/v1/sensitive/save")
    public  ResponseResult save1(@RequestBody WmSensitive wmSensitive){
        return ResponseResult.okResult(wmSensitiveService.save(wmSensitive));
    }

    /*
    *修改
    * */
    @PostMapping("/api/v1/sensitive/update")
    public ResponseResult update(@RequestBody WmSensitive wmSensitive){
        return  null;
    }
}
